<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
        {% load staticfiles %}

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>MovieGEEKs</title>

    <!-- Bootstrap -->
    <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css" rel="stylesheet">


    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
    <script src="{% static 'js/collector.js' %}"></script>
    <script src="http://d3js.org/d3.v3.min.js"></script>
    <script src="http://dimplejs.org/dist/dimple.v2.2.0.min.js"></script>
</head>
<body>
    <div class="container">
        <div class="row">
            <h2>Cluster {{ cluster_id }}</h2>
            <p>Cluster has {{members_count}} members</p>

        </div>
        <div class="row">

            <div id="chartContainer">
              <script type="text/javascript">
                var svg = dimple.newSvg("#chartContainer", 700, 400);
                var data = [
                  {% for key, value in genres.items %}
                    { "name": '{{key}}', "value": {{value}} },
                  {% endfor %}
                ];
                var chart = new dimple.chart(svg, data);
                chart.setBounds(50, 10, 600, 300);

                x = chart.addCategoryAxis("x", "name");
                y = chart.addMeasureAxis("y", "value");
                chart.addSeries(null, dimple.plot.bar);
                x.addOrderRule("name")
                chart.draw();
              </script>
            </div>
        </div>
        <div class="row">
            {% for user_id in members %}
                <a href="/analytics/user/{{ user_id}}">{{ user_id }}</a>
            {% endfor%}
        </div>
    </div>
</body>
</html>